<?php
FLEA::loadClass('FLEA_Rbac_UsersManager');

class Model_SysUsers extends FLEA_Rbac_UsersManager
{
	var $tableName = 'sysusers';
	var $primaryKey = 'user_id';
	
	var $manyToMany = array(
        'tableClass' => 'Model_SysRoles',
        'mappingName' => 'roles',
        'joinTable' => 'sysusers_has_sysroles',
    );
    
    var $hasOne = array(
    array('tableClass' => 'Model_DeclarePerson',
		'foreignKey' => 'user_id',
		'mappingName' => 'declareperson',),
    array('tableClass' => 'Model_DeclareCompany',
		'foreignKey' => 'user_id',
		'mappingName' => 'declarecompany',),
    );
    
    var $hasMany = array(
    	'tableClass' => 'Model_DispatchingCompany',
    	'foreignKey' => 'user_id',
		'mappingName' => 'dispatchingcompany',
    );
    
    var $rolesField = 'roles';
}
?>